﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Win8Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d">

    <local:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>

    <Style TargetType="local:Calendar">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:Calendar">
                    <Border
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}" d:DesignWidth="1086" d:DesignHeight="761">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="Orientation">
                                <VisualState x:Name="FullScreenLandscape"/>
                                <VisualState x:Name="Filled"/>
                                <VisualState x:Name="Snapped">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" Storyboard.TargetProperty="(FrameworkElement.MaxWidth)" Storyboard.TargetName="ItemsGrid" d:IsOptimized="True" To="280"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetProperty="(FrameworkElement.MaxHeight)" Storyboard.TargetName="ItemsGrid" d:IsOptimized="True" To="280"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetProperty="(FrameworkElement.MaxWidth)" Storyboard.TargetName="grid" d:IsOptimized="True" To="280"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetProperty="(FrameworkElement.MaxHeight)" Storyboard.TargetName="grid" d:IsOptimized="True" To="280"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetProperty="(TextBlock.FontSize)" Storyboard.TargetName="textBlock" d:IsOptimized="True" To="21.333"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetProperty="(Control.FontSize)" Storyboard.TargetName="PreviousMonthButton" d:IsOptimized="True" To="21.333"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetProperty="(Control.FontSize)" Storyboard.TargetName="NextMonthButton" d:IsOptimized="True" To="21.333"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="PreviousMonthButton" d:IsOptimized="True" To="60"/>
                                        <DoubleAnimation Duration="0" Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="NextMonthButton" d:IsOptimized="True" To="60"/>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="PreviousMonthButton">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="NextMonthButton">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.FontWeight)" Storyboard.TargetName="Sunday">
                                        	<DiscreteObjectKeyFrame KeyTime="0">
                                        		<DiscreteObjectKeyFrame.Value>
                                                    <FontWeight>Normal</FontWeight>
                                        		</DiscreteObjectKeyFrame.Value>
                                        	</DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.FontWeight)" Storyboard.TargetName="Monday">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <FontWeight>Normal</FontWeight>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.FontWeight)" Storyboard.TargetName="Tuesday">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <FontWeight>Normal</FontWeight>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.FontWeight)" Storyboard.TargetName="Wednesday">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <FontWeight>Normal</FontWeight>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.FontWeight)" Storyboard.TargetName="Thursday">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <FontWeight>Normal</FontWeight>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.FontWeight)" Storyboard.TargetName="Friday">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <FontWeight>Normal</FontWeight>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(TextBlock.FontWeight)" Storyboard.TargetName="Saturday">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <FontWeight>Normal</FontWeight>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="FullScreenPortrait"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Grid x:Name="grid" MaxHeight="10000" MaxWidth="10000">
                            <Grid.Background>
                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                    <GradientStop Color="#FF1732BF" Offset="0"/>
                                    <GradientStop Color="#FFC2C6D1" Offset="1"/>
                                    <GradientStop Color="#FF9AABEA" Offset="0.5"/>
                                    <GradientStop Color="#FF4B6FE4" Offset="0.115"/>
                                    <GradientStop Color="#FF2142B7" Offset="0.2"/>
                                </LinearGradientBrush>
                            </Grid.Background>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <TextBlock x:Name="textBlock" 
                                Text="{TemplateBinding YearMonthLabel}" 
                                FontSize="40"
                                Grid.Column="1" 
                                HorizontalAlignment="Center" 
                                VerticalAlignment="Center"/>
                            <Button 
                                BorderThickness="0"
                                Width="100"
                                Content="&lt;" 
                                FontSize="48"
                                Grid.Column="0"
                                x:Name="PreviousMonthButton" 
                                HorizontalAlignment="Left" 
                                VerticalAlignment="Center" 
                                HorizontalContentAlignment="Left"
                                Visibility="{Binding ShowNavigationButtons, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource Mode=TemplatedParent}}" Margin="0,-10,0,0"/>
                            <Button 
                                BorderThickness="0"
                                Width="100"
                                Content="&gt;" 
                                FontSize="48"
                                Grid.Column="2" 
                                x:Name="NextMonthButton" 
                                HorizontalAlignment="Right" 
                                VerticalAlignment="Center" 
                                HorizontalContentAlignment="Right"
                                Visibility="{Binding ShowNavigationButtons, Converter={StaticResource BooleanToVisibilityConverter}, RelativeSource={RelativeSource Mode=TemplatedParent}}" Margin="0,-10,0,0"/>
                            <Grid Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="3" x:Name="ItemsGrid" MaxWidth="10000" MaxHeight="10000">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <TextBlock x:Name="Sunday" Text="{TemplateBinding Sunday}" FontWeight="ExtraBold" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1"/>
                                <TextBlock x:Name="Monday" Text="{TemplateBinding Monday}" FontWeight="ExtraBold" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="2"/>
                                <TextBlock x:Name="Tuesday" Text="{TemplateBinding Tuesday}" FontWeight="ExtraBold" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="3"/>
                                <TextBlock x:Name="Wednesday" Text="{TemplateBinding Wednesday}" FontWeight="ExtraBold" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="4"/>
                                <TextBlock x:Name="Thursday" Text="{TemplateBinding Thursday}" FontWeight="ExtraBold" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="5"/>
                                <TextBlock x:Name="Friday" Text="{TemplateBinding Friday}" FontWeight="ExtraBold" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="6"/>
                                <TextBlock x:Name="Saturday" Text="{TemplateBinding Saturday}" FontWeight="ExtraBold" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="7"/>
                            </Grid>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="FontSize" Value="18"/>
    </Style>

    <Style TargetType="local:CalendarItem">
        <Setter Property="Foreground"  Value="White"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate  TargetType="local:CalendarItem">
                    <Grid x:Name="root" d:DesignWidth="272" d:DesignHeight="246" Margin="3,3,3,5">
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="Orientation">
                                <VisualState x:Name="FullScreenLandscape"/>
                                <VisualState x:Name="FullScreenPortrait"/>
                                <VisualState x:Name="Snapped">
                                    <Storyboard>
                                        <DoubleAnimation Duration="0" To="10" Storyboard.TargetProperty="(TextBlock.FontSize)" Storyboard.TargetName="DayNumberBlock" d:IsOptimized="True"/>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.CornerRadius)" Storyboard.TargetName="border1">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <CornerRadius>2</CornerRadius>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.CornerRadius)" Storyboard.TargetName="border">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <CornerRadius>2</CornerRadius>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.CornerRadius)" Storyboard.TargetName="glow">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <CornerRadius>2</CornerRadius>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.CornerRadius)" Storyboard.TargetName="shine">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <CornerRadius>2</CornerRadius>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="DayNumberBlock">
                                            <DiscreteObjectKeyFrame KeyTime="0">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Thickness>0,0,2,2</Thickness>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Filled"/>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="border1" BorderThickness="1,1,1,1" CornerRadius="30">
                            <Border x:Name="border" BorderBrush="#FF000000" BorderThickness="1,1,1,1" CornerRadius="30">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FF17099E"/>
                                        <GradientStop Color="#FF0B1579" Offset="1"/>
                                        <GradientStop Color="#FF4542A1" Offset="0.4"/>
                                        <GradientStop Color="#FF2E32DE" Offset="0.7"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                                <Grid x:Name="grid">
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="0.5*"/>
                                        <RowDefinition Height="0.5*"/>
                                    </Grid.RowDefinitions>
                                    <Border Opacity="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" x:Name="glow" Grid.RowSpan="2" CornerRadius="30">
                                        <Border.Background>
                                            <LinearGradientBrush>
                                                <GradientStop Color="#B22072E4" Offset="0"/>
                                                <GradientStop Color="#001733E6" Offset="1"/>
                                                <GradientStop Color="#5A000002" Offset="0.4"/>
                                                <GradientStop Color="#472844AC" Offset="0.7"/>
                                            </LinearGradientBrush>
                                        </Border.Background>
                                    </Border>
                                    <Border VerticalAlignment="Stretch" HorizontalAlignment="Stretch" 
                                            Margin="0,0,0,0" x:Name="shine" CornerRadius="30" Grid.RowSpan="2">
                                        <Border.Background>
                                            <LinearGradientBrush EndPoint="0.5,0.9" StartPoint="0.5,0.0">
                                                <GradientStop Color="#7F85A2CA" Offset="0"/>
                                                <GradientStop Color="#7F1D1577" Offset="1"/>
                                                <GradientStop Color="#7FA6BCDB" Offset="0.4"/>
                                                <GradientStop Color="#7F8196C1" Offset="0.6"/>
                                                <GradientStop Color="#7F314D7A" Offset="0.8"/>
                                                <GradientStop Color="#7FB5C9E6" Offset="0.2"/>
                                            </LinearGradientBrush>
                                        </Border.Background>
                                    </Border>
                                    <TextBlock 
                                    	x:Name="DayNumberBlock"
                                    	Text="{Binding DayNumber, RelativeSource={RelativeSource Mode=TemplatedParent}}" 
                                    	Foreground="White" 
                                    	FontWeight="ExtraBold"
                                    	FontSize="40"
                                    	HorizontalAlignment="Right" 
                                    	VerticalAlignment="Bottom" 
                                    	Margin="0,0,10,10"
                                    	Grid.Row="1"/>
                                </Grid>
                            </Border>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="local:CalendarWeekItem">
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate  TargetType="local:CalendarWeekItem">
                    <Grid x:Name="OuterGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                        <Border 
                            BorderThickness="2"
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch">
                            <Grid Height="60" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                    <RowDefinition Height="*"/>
                                </Grid.RowDefinitions>
                                <Rectangle Grid.RowSpan="2" x:Name="BackgroundRectangle" Fill="{TemplateBinding Background}" />
                                <TextBlock 
                                    x:Name="WeekNumberBlock"
                                    Text="{Binding WeekNumber, RelativeSource={RelativeSource Mode=TemplatedParent}}" 
                                    Foreground="{TemplateBinding Foreground}" 
                                    FontWeight="ExtraBold"
                                    FontSize="40"
                                    HorizontalAlignment="Right" 
                                    VerticalAlignment="Top" 
                                    Margin="0,2,2,0"/>

                            </Grid>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
